import {Component, OnInit} from '@angular/core';
import {BladeService} from '../../../shared/blade.service';
import {BladeData} from '../../../shared/blade/blade-data';
import {CompanyListComponent} from './company-list/company-list.component';
import {Blade} from '../../../shared/blade/blade.model';
import {Observable} from 'rxjs/Observable';


@Component({
  selector: 'app-company',
  templateUrl: './company.component.html',
  styleUrls: ['./company.component.css'],
  providers: [BladeService]
})
export class CompanyComponent implements OnInit {

  currentBlade: Blade

  constructor(public bladeService: BladeService) {
  }

  ngOnInit() {
    this.createCompanyListBlade()
  }

  /**
   * 创建菜单列表弹出层
   *
   *
   * @memberof DicComponent
   */
  createCompanyListBlade() {
    let data: BladeData = new BladeData();
    data.id = 'companyList';
    data.title = '组织结构列表';
    data.isClosingDisabled = true;
    this.currentBlade = this.bladeService.createBlade(CompanyListComponent, data);
    this.bladeService.showBlade(this.currentBlade);
  }

  /**
   * 是否可以离开
   *
   *
   * @memberof DicComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}


// WEBPACK FOOTER //
// ./src/app/module/basic/company/company.component.ts
